﻿using System.Collections.Generic;
using System.Reflection;

namespace Myotragus.Data.Util
{
	internal class PropertyInfoComparer : IEqualityComparer<PropertyInfo>
	{
		#region IEqualityComparer<PropertyInfo> Members

		public bool Equals(PropertyInfo x, PropertyInfo y)
		{
			return x.Name == y.Name && x.PropertyType == y.PropertyType;
		}

		public int GetHashCode(PropertyInfo obj)
		{
			return obj.Name.GetHashCode() + obj.PropertyType.GetHashCode();
		}

		#endregion IEqualityComparer<PropertyInfo> Members
	}
}